home *** CD-ROM | disk | FTP | other *** search
- { DUMBTERM
- Plain vanilla comm program to demonstrate SUPERCOM.PAS
-
- (C) Copyright 1986, Doctor Debug, Pittsburgh Pa
- All Rights Reserved
-
- SUPER.COM must be loaded for this program to function correctly
-
- Do not run this program from the Turbo environment! Compile to a COM
- file first!
-
- To exit program, type Ctrl-Z
- }
- {$ISupercom.Pas} {Bring in Comm library}
-
- Var
- x:LString; {255 byte string - defined in SUPERCOM library}
- a,a1:char;
- i,b,c:integer;
- FilVar: Text;
- FileName: String[14];
-
- Begin {Main Program}
- writeln ('Opening Supercom Port');
- InitPort(1,1200,Even,7,1); {opens port 1}
- ClearBuff; {make sure buffer empty}
- FileName := 'TEXT.TXT';
- Assign(FilVar,FileName); {open file}
- Rewrite(FilVar); {write from beginning}
- a := ' ';
- while a <> Chr(26) {26 = end of file char}
- Begin
- if keypressed then {this loop if key was pressed}
- begin
- a := GetKey; {get keypress}
- If a <> chr(26) then {control Z? (signifies end)}
- XmitCh(a); {no, send character}
- end;
- c := rlen; {# of chars in input buffer}
- If c <> 0 then {this loop if there are chars}
- begin
- if abs(c) > 255 then {only get blocks of 255}
- c := 255;
- recblk(c,x); {input data into x array}
- for i := 1 to ord(x[0]) do {now print to screen}
- Begin
- write(x[i]);
- write(filvar,x[i]); {and to file}
- End; {for}
- end; {if}
- end; {while}
- Close(FilVar); {close output file}
- ClosePort; {close Supercom port}
- end. {Done!}